+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
+2002-01-25 Alex Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c (gdk_drawable_impl_fb_class_init):
+ Implement copy_to_image instead of get_image
+
+ * gdk/linux-fb/gdkimage-fb.c:
+ Implement _gdk_image_new_for_depth, _gdk_windowing_get_bits_for_depth and
+ _gdk_fb_copy_to_image.
+ Based in part on patch from Mathieu Lacage <mathieu_lacage@realmagic.fr>
+
+ * gdk/linux-fb/gdkmain-fb.c:
+ Make ENABLE_FB_MANAGER region larger.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Change _gdk_fb_get_image to _gdk_fb_copy_to_image.
+
2002-01-25 Sven Neumann <sven@gimp.org>
* gtk/gtkwindow.c (gtk_window_get_size): changed the comment so
drawable_class->get_depth = gdk_fb_get_depth;
drawable_class->get_visual = gdk_fb_get_visual;
- drawable_class->get_image = _gdk_fb_get_image;
+ drawable_class->_copy_to_image = _gdk_fb_copy_to_image;
}
static void
return object_type;
}
+
+GdkImage*
+_gdk_image_new_for_depth (GdkImageType type,
+ GdkVisual *visual,
+ gint width,
+ gint height,
+ gint depth)
+{
+ GdkImage *image;
+ GdkImagePrivateFB *private;
+
+ g_return_val_if_fail (!visual || GDK_IS_VISUAL (visual), NULL);
+ g_return_val_if_fail (visual || depth != -1, NULL);
+
+ if (visual)
+ depth = visual->depth;
+
+ image = g_object_new (gdk_image_get_type (), NULL);
+ private = GDK_IMAGE_PRIVATE_DATA (image);
+
+ image->type = 0;
+ image->visual = visual;
+ image->width = width;
+ image->height = height;
+ image->depth = depth;
+
+ image->byte_order = 0;
+ image->bits_per_pixel = image->depth;
+ image->bpp = image->depth/8;
+ image->bpl = (width * image->depth + 7) / 8;
+ image->mem = g_malloc (image->bpl * height);
+
+ return image;
+}
+
GdkImage *
gdk_image_new_bitmap(GdkVisual *visual,
gpointer data,
gint width,
gint height)
{
- GdkImage *image;
- GdkImagePrivateFB *private;
-
- image = g_object_new (gdk_image_get_type (), NULL);
- private = GDK_IMAGE_PRIVATE_DATA (image);
-
- image->type = 0;
- image->visual = visual;
- image->width = width;
- image->height = height;
- image->depth = visual->depth;
-
- image->byte_order = 0;
- image->bits_per_pixel = image->depth;
- image->bpp = image->depth/8;
- image->bpl = (width * image->depth + 7) / 8;
- image->mem = g_malloc (image->bpl * height);
-
- return image;
+ return _gdk_image_new_for_depth (type, visual, width, height, -1);
}
GdkImage*
-_gdk_fb_get_image (GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+_gdk_fb_copy_to_image (GdkDrawable *drawable,
+ GdkImage *image,
+ gint src_x,
+ gint src_y,
+ gint dest_x,
+ gint dest_y,
+ gint width,
+ gint height)
{
- GdkImage *image;
GdkImagePrivateFB *private;
GdkPixmapFBData fbd;
GdkRegion *region = NULL;
g_return_val_if_fail (drawable != NULL, NULL);
- image = g_object_new (gdk_image_get_type (), NULL);
+ if (image == NULL)
+ {
+ image = g_object_new (gdk_image_get_type (), NULL);
+
+ image->type = GDK_IMAGE_NORMAL;
+ image->visual = gdk_drawable_get_visual (drawable);
+ image->width = width;
+ image->height = height;
+ image->bits_per_pixel = GDK_DRAWABLE_FBDATA (drawable)->depth;
+ image->depth = image->bits_per_pixel;
+
+ if (image->bits_per_pixel <= 8)
+ image->bpp = 1;
+ else if (image->bits_per_pixel <= 16)
+ image->bpp = 2;
+ else if (image->bits_per_pixel <= 24)
+ image->bpp = 3;
+ else
+ image->bpp = 4;
+ image->byte_order = 1;
+
+ image->bpl = (image->width * image->depth + 7) / 8; /* Packed pixels */
+ image->mem = g_malloc (image->bpl * image->height);
+
+ dest_x = 0;
+ dest_y = 0;
+ }
+
private = GDK_IMAGE_PRIVATE_DATA (image);
-
- image->type = GDK_IMAGE_NORMAL;
- image->visual = gdk_drawable_get_visual (drawable);
- image->width = width;
- image->height = height;
- image->bits_per_pixel = GDK_DRAWABLE_FBDATA (drawable)->depth;
- image->depth = image->bits_per_pixel;
-
- if (image->bits_per_pixel <= 8)
- image->bpp = 1;
- else if (image->bits_per_pixel <= 16)
- image->bpp = 2;
- else if (image->bits_per_pixel <= 24)
- image->bpp = 3;
- else
- image->bpp = 4;
- image->byte_order = 1;
-
- image->bpl = (image->width * image->depth + 7) / 8; /* Packed pixels */
- image->mem = g_malloc (image->bpl * image->height);
/* Fake its existence as a pixmap */
memset (&fbd, 0, sizeof(fbd));
gdk_fb_draw_drawable_2 ((GdkPixmap *)&fbd,
_gdk_fb_screen_gc,
drawable,
- x, y,
- 0, 0,
+ src_x, src_y,
+ dest_x, dest_y,
width, height,
TRUE, TRUE);
_gdk_image_exit(void)
{
}
+
+/* copy/pasted from gdkimage-win32.c */
+gint
+_gdk_windowing_get_bits_for_depth (gint depth)
+{
+ if ((1 == depth) || (8 == depth) || (16 == depth) ||
+ (24 == depth) || (32 == depth))
+ return depth;
+ else if (15 == depth)
+ return 16;
+ else
+ g_assert_not_reached ();
+
+ return 0;
+}
+
static void
gdk_fb_manager_connect (GdkFBDisplay *display)
{
+#ifdef ENABLE_FB_MANAGER
int fd;
struct sockaddr_un addr;
struct msghdr msg = {0};
display->manager_blocked = FALSE;
display->manager_fd = -1;
-#ifdef ENABLE_FB_MANAGER
fd = socket (PF_UNIX, SOCK_STREAM, 0);
g_print ("socket: %d\n", fd);
void _gdk_fb_gc_calc_state (GdkGC *gc,
GdkGCValuesMask changed);
-GdkImage *_gdk_fb_get_image (GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height);
+GdkImage *_gdk_fb_copy_to_image (GdkDrawable *drawable,
+ GdkImage *image,
+ gint src_x,
+ gint src_y,
+ gint dest_x,
+ gint dest_y,
+ gint width,
+ gint height);
void gdk_fb_drawable_clear (GdkDrawable *drawable);
void gdk_fb_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,